package cn.zzu.Etrip.destineday.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.etrip.R;

import cn.zzu.Etrip.destineday.service.DestineDay;


/**
 * Created by ASUS on 2018/5/23.
 */

public class DestineDayActivity extends AppCompatActivity {


    Button xinxiang,shangqiu,xinyang,anyang,xuchang,sanmenxia;

    ImageView imageView1,imageView2,imageView3,imageView4,imageView5,imageView6;

    TextView text1,text2,text3,text4,text5,text6;

    DestineDay destineDay;

    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.specticalprice);

        xinxiang = findViewById(R.id.xinxiang);
        xinyang = findViewById(R.id.xinyang);
        anyang = findViewById(R.id.anyang);
        shangqiu = findViewById(R.id.shangqiu);
        xuchang = findViewById(R.id.xuchang);
        sanmenxia = findViewById(R.id.sanmenxia);

        imageView1 = findViewById(R.id.image1);
        imageView2 = findViewById(R.id.image2);
        imageView3 = findViewById(R.id.image3);
        imageView4 = findViewById(R.id.image4);
        imageView5 = findViewById(R.id.image5);
        imageView6 = findViewById(R.id.image6);

        text1 = findViewById(R.id.text1);
        text2 = findViewById(R.id.text2);
        text3 = findViewById(R.id.text3);
        text4 = findViewById(R.id.text4);
        text5 = findViewById(R.id.text5);
        text6 = findViewById(R.id.text6);

        xinxiang.setBackgroundResource(R.color.family_colorBG);
        destineDay = new DestineDay(DestineDay.xinxiang);

    }




    public void setXinxiang(View view){

        imageView1.setImageResource(R.mipmap.special_md_xinxiang_01);
        imageView2.setImageResource(R.mipmap.special_md_xinxiang_02);
        imageView3.setImageResource(R.mipmap.special_md_xinxiang_03);
        imageView4.setImageResource(R.mipmap.special_md_xinxiang_04);
        imageView5.setImageResource(R.mipmap.special_md_xinxiang_05);
        imageView6.setImageResource(R.mipmap.special_md_xinxiang_06);

       xinxiang.setBackgroundResource(R.color.family_colorBG);
        xuchang.setBackgroundResource(0);
        xinyang.setBackgroundResource(0);
        shangqiu.setBackgroundResource(0);
        sanmenxia.setBackgroundResource(0);
        anyang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.xinxiang);//本页面图片装入集合

    }
    public void setShangqiu(View view){

        imageView1.setImageResource(R.mipmap.special_md_shangqiu_01);
        imageView2.setImageResource(R.mipmap.special_md_shangqiu_02);
        imageView3.setImageResource(R.mipmap.special_md_shangqiu_03);
        imageView4.setImageResource(R.mipmap.special_md_shangqiu_04);
        imageView5.setImageResource(R.mipmap.special_md_shangqiu_05);
        imageView6.setImageResource(R.mipmap.special_md_shangqiu_06);

       shangqiu.setBackgroundResource(R.color.family_colorBG);
        sanmenxia.setBackgroundResource(0);
        anyang.setBackgroundResource(0);
        xuchang.setBackgroundResource(0);
        xinyang.setBackgroundResource(0);
        xinxiang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.shangqiu);

    }
    public void setXinyang(View view){

        imageView1.setImageResource(R.mipmap.special_md_xinyang_01);
        imageView2.setImageResource(R.mipmap.special_md_xinyang_02);
        imageView3.setImageResource(R.mipmap.special_md_xinyang_03);
        imageView4.setImageResource(R.mipmap.special_md_xinyang_04);
        imageView5.setImageResource(R.mipmap.special_md_xinyang_05);
        imageView6.setImageResource(R.mipmap.special_md_xinyang_06);

        xinyang.setBackgroundResource(R.color.family_colorBG);
        shangqiu.setBackgroundResource(0);
        sanmenxia.setBackgroundResource(0);
        anyang.setBackgroundResource(0);
        xuchang.setBackgroundResource(0);
        xinxiang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.xinyang);

    }
    public void setAnyang(View view){

        imageView1.setImageResource(R.mipmap.special_md_anyang_01);
        imageView2.setImageResource(R.mipmap.special_md_anyang_02);
        imageView3.setImageResource(R.mipmap.special_md_anyang_03);
        imageView4.setImageResource(R.mipmap.special_md_anyang_04);
        imageView5.setImageResource(R.mipmap.special_md_anyang_05);
        imageView6.setImageResource(R.mipmap.special_md_anyang_06);

       anyang.setBackgroundResource(R.color.family_colorBG);
        xuchang.setBackgroundResource(0);
        xinxiang.setBackgroundResource(0);
        shangqiu.setBackgroundResource(0);
        sanmenxia.setBackgroundResource(0);
        xinyang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.anyang);

    }
    public void setXuchang(View view){

        imageView1.setImageResource(R.mipmap.special_md_xuchang_01);
        imageView2.setImageResource(R.mipmap.special_md_xuchang_02);
        imageView3.setImageResource(R.mipmap.special_md_xuchang_03);
        imageView4.setImageResource(R.mipmap.special_md_xuchang_04);
        imageView5.setImageResource(R.mipmap.special_md_xuchang_05);
        imageView6.setImageResource(R.mipmap.special_md_xuchang_06);

        xuchang.setBackgroundResource(R.color.family_colorBG);
        xinxiang.setBackgroundResource(0);
        shangqiu.setBackgroundResource(0);
        sanmenxia.setBackgroundResource(0);
        xinyang.setBackgroundResource(0);
        anyang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.xuchang);

    }
    public void setSanmenxia(View view){

        imageView1.setImageResource(R.mipmap.special_md_sanmenxia_01);
        imageView2.setImageResource(R.mipmap.special_md_sanmenxia_02);
        imageView3.setImageResource(R.mipmap.special_md_sanmenxia_03);
        imageView4.setImageResource(R.mipmap.special_md_sanmenxia_04);
        imageView5.setImageResource(R.mipmap.special_md_sanmenxia_05);
        imageView6.setImageResource(R.mipmap.special_md_sanmenxia_06);

        sanmenxia.setBackgroundResource(R.color.family_colorBG);
        xinyang.setBackgroundResource(0);
        anyang.setBackgroundResource(0);
        xinxiang.setBackgroundResource(0);
        shangqiu.setBackgroundResource(0);
        xuchang.setBackgroundResource(0);

        destineDay = new DestineDay(DestineDay.sanmenxia);

    }


    public void pay1(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);

        Bundle bundle = new Bundle();
        bundle.putString("name",text1.getText().toString());
        bundle.putInt("value",destineDay.image.get(0));//从集合调用图片地址
        intent.putExtras(bundle);

        startActivity(intent);
    }
    public void pay2(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("name",text2.getText().toString());
        bundle.putInt("value",destineDay.image.get(1));
        intent.putExtras(bundle);

        startActivity(intent);
    }
    public void pay3(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);

        Bundle bundle = new Bundle();
        bundle.putString("name",text3.getText().toString());
        bundle.putInt("value",destineDay.image.get(2));
        intent.putExtras(bundle);

        startActivity(intent);
    }
    public void pay4(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);

        Bundle bundle = new Bundle();
        bundle.putString("name",text4.getText().toString());
        bundle.putInt("value",destineDay.image.get(3));
        intent.putExtras(bundle);

        startActivity(intent);
    }
    public void pay5(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);

        Bundle bundle = new Bundle();
        bundle.putString("name",text5.getText().toString());
        bundle.putInt("value",destineDay.image.get(4));
        intent.putExtras(bundle);

        startActivity(intent);
    }
    public void pay6(View view){

        Intent intent = new Intent(DestineDayActivity.this,DestineDayPayActivity.class);

        Bundle bundle = new Bundle();
        bundle.putString("name",text6.getText().toString());
        bundle.putInt("value",destineDay.image.get(5));
        intent.putExtras(bundle);

        startActivity(intent);
    }
}
